﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using laba2.Context;
using laba2.Entity;
using laba2.Repository.IRepository;

namespace laba2.Repository.DAO
{
   public class CourseDAO:GenericDAO<Course>, ICourseRepository
   {
       public List<Course> GetByName(string name)
       {
           using (var context=new Lab3DBContext())
           {
               var result = from course in context.Courses
                            where course.Name == name
                            select course;
               return result.ToList();
           }
       }
   }
}
